package com.test.bean;

import java.util.Date;
import java.util.HashMap;
import java.util.Map;

import javax.jdo.annotations.IdGeneratorStrategy;
import javax.jdo.annotations.IdentityType;
import javax.jdo.annotations.PersistenceCapable;
import javax.jdo.annotations.Persistent;
import javax.jdo.annotations.PrimaryKey;

@PersistenceCapable(identityType = IdentityType.APPLICATION)
public class Employee {

	@PrimaryKey
	@Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
	private Long id;

	@Persistent
	private String firstName;

	@Persistent
	private String lastName;

	@Persistent
	private Date hireDate;

	public Employee(String firstName, String lastName, Date hireDate) {

		this.firstName = firstName;

		this.lastName = lastName;

		this.hireDate = hireDate;

	}

	// 아래는 필드 접근을 위한 메소드들. JDO는 이 메소드들을 사용하지 않지만, 우리의 애플리케이션에서 필요해요.

	public Long getId() {

		return id;

	}

	public String getFirstName() {

		return firstName;

	}
	
	public Map getData(){
		Map data = new HashMap();
		data.put("firstName", firstName);
		data.put("lastName", lastName);
		data.put("hireDate", hireDate);
		
		return data;
	}

	// ... other accessors...

}